<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>边框--三角形</title>
    <style>
      div.box1{
          width: 0;
          height: 0;
          border-top: 10px solid red;
          border-left: 10px solid transparent;
          border-right: 10px solid transparent;
      }

      div.box2{
          width: 0;
          height: 0;
          border-bottom: 10px solid green;
          border-left: 10px solid transparent;
          border-right: 10px solid transparent;
      }
    </style>
</head>

<body>
    <div class="box1"></div>

    <div class="box2"></div>
</body>

</html>